package com.infoguia.db;

public class InfoguiaDB {

	/*
	 * Estructura de la Base de datos SQLLite
	 */

	public static final String KEY_ROWID = "_id";
	
	/*
	 * Nombre de las tablas
	 */

	protected static final String T_CATEGORY = "t001_category";
	protected static final String T_COMPANY = "t002_company";
	protected static final String T_PHONE = "t003_phone";
	protected static final String T_COMPANY_CATEGORY = "t004_company_category";
	protected static final String T_STATE= "t005_state";

	protected static final String CREATE_CATEGORY = "create table "+T_CATEGORY+" ("+KEY_ROWID+" integer primary key autoincrement, "			
			+ "name text not null, " 
			+ "is_principal text not null, "
			+ "is_recomendada text not null); ";

	protected static final String CREATE_COMPANY = "create table "+T_COMPANY+" ("+KEY_ROWID+" integer primary key autoincrement, "			
			+ "name text not null, "
			+ "description text not null, "
			+ "address text not null, "
			+ "mail text null, "
			+ "map text null, "
			+ "logo text null, "
			+ "web text null, "
			+ "id_state integer not null);";

	protected static final String CREATE_PHONE = "create table "+T_PHONE+" ("+KEY_ROWID+" integer primary key autoincrement, "
			+ "code integer not null, "
			+ "number integer not null, "
			+ "id_company integer not null); ";
	
	protected static final String CREATE_COMPANY_CATEGORY = "create table "+T_COMPANY_CATEGORY
			+" ( id_company integer not null, "
			+" id_category integer not null); ";
	
	protected static final String CREATE_STATE = "create table "+T_STATE+" ("+KEY_ROWID+" integer primary key autoincrement, "
			+ "name text not null);";

	
	/*
	 * Parametros de Configuracion
	 */
	protected static final String DATABASE_NAME = "infoguia";
	protected static final int DATABASE_VERSION = 2;

	
}
